﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Net;

namespace Universe.Computing.UCSharedLib
{
    public class UCConfig
    {
        private static volatile UCConfig instance;
        private static object syncRoot = new Object();

        private UCConfig()
        {
            System.Net.IPHostEntry ipEntry = System.Net.Dns.GetHostEntry("localhost");
            System.Net.IPAddress[] addr = ipEntry.AddressList;
            ServerIP = addr[1];
            ServerPort = 3333;
        }

        public static UCConfig Instance
        {
            get
            {
                if (instance == null)
                {
                    lock (syncRoot)
                    {
                        if (instance == null)
                            instance = new UCConfig();
                    }
                }

                return instance;
            }
        }
        public IPAddress ServerIP
        {
            get;
            set;
        }
        public int ServerPort
        {
            get;
            set;
        }
    }
}
